package com.wjy;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@ComponentScan(value = "com.wjy")
@EntityScan(value = "com.wjy")
@MapperScan(value = "com.wjy")
@EnableScheduling
@EnableAsync
// @EnableWebMvc
@EnableSwagger2
@EnableCaching
@EnableTransactionManagement
@EnableAspectJAutoProxy
@SpringBootApplication
public class QSApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {

        // 关闭热部署
        // System.setProperty("spring.devtools.restart.enabled", "false");
        // SpringApplication.run(QSApplication.class, args);

        // SpringApplication application = new SpringApplication(QSApplication.class);
        // 配置监听
        // application.addListeners(new ApplicationReadyEventListener());
        // application.run(args);

        // ConfigurableApplicationContext context = SpringApplication.run(QSApplication.class, args);
        // String authorController = context.getBean("authorController").getClass().getName();
        // String authorServiceImpl = context.getBean("authorServiceImpl").getClass().getName();
        // log.info("authorController --> " + authorController);
        // log.info("authorServiceImpl --> " + authorServiceImpl);

        SpringApplication.run(QSApplication.class, args);

    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(QSApplication.class);
    }

}
